package com.code.test.first.stack;

/**
 * 先进先出
 */
public class MyQueue {

    int[] items;
    int count = 0;

    public MyQueue(int capacity) {
        this.items = new int[capacity];
    }

    public void push(int x) {
        if (count > items.length) return;
        items[count++] = x;
    }

    public int pop() {
        if (count == 0) return -1;
        int temp = items[count - 1];
        count--;
        items[count - 1] = Integer.parseInt(null);
        return temp;
    }

    public int peek() {
        return 0;
    }

    public boolean empty() {
        return false;
    }

}
